﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Model;
using University.Workshop.Business;
using System.Data.SqlClient;

namespace University.Workshop.Presenters
{
    public class AmbulancePresenter
    {
        IAmbulance ia;

        public AmbulancePresenter(IAmbulance ia)
        {
            this.ia = ia;
        }

        public string AmbulanceRegister()
        {
            Ambulance newAmbulance = new Ambulance(ia.AmbulanceId, ia.Model, ia.Year, ia.PurchaseYear, ia.State, ia.Deleted);
            return AmbulanceManager.AmbulanceRegister(newAmbulance);
        }

        public static ICollection<Ambulance> AmbulanceSearch()
        {
            return AmbulanceManager.AmbulanceSearch();
        }

        public string AmbulanceModify(string oldAmbulanceId)
        {
            Ambulance newAmbulance = new Ambulance(ia.AmbulanceId, ia.Model, ia.Year, ia.PurchaseYear, ia.State, ia.Deleted);
            return AmbulanceManager.AmbulanceModify(oldAmbulanceId, newAmbulance);
        }

        public static bool AmbulanceExists(string ambulanceId)
        {
            return Business.AmbulanceManager.AmbulanceExists(ambulanceId);
        }

        public static Ambulance ObtainAmbulance(string ambulanceId)
        {
            return Business.AmbulanceManager.ObtainAmbulance(ambulanceId);
        }

        public static string DeleteAmbulance(string ambulanceId)
        {
            return Business.AmbulanceManager.DeleteAmbulance(ambulanceId);
        }
    }
}
